package com.gitee.wsl.ext.number


fun Float.interpolate(l: Float, r: Float): Float = (l + (r - l) * this)

fun Float.interpolate(l: Int, r: Int): Int = (l + (r - l) * this).toInt()

fun Float.interpolate(l: Long, r: Long): Long = (l + (r - l) * this).toLong()

fun Float.interpolate(l: Double, r: Double): Double = (l + (r - l) * this)

fun Double.interpolate(l: Float, r: Float): Float = (l + (r - l) * this).toFloat()

fun Double.interpolate(l: Double, r: Double): Double = (l + (r - l) * this)

fun Double.interpolate(l: Int, r: Int): Int = (l + (r - l) * this).toInt()

fun Double.interpolate(l: Long, r: Long): Long = (l + (r - l) * this).toLong()